package scala.Implicit.Conversion

object MainOB {
   def main(args: Array[String]): Unit = {
      val g = Greeting.showGreet("hung")(Joe.promp)
      val Fu = new PromPrefer("Console ")
      val g1 = Greeting.showGreet("hung")(Fu)

      //implicit conversion example
      import ImplicitConversion._
      val x1 = new Complex(3.0, 5.0)
      val x2 = new Complex(5.0, 10.0)
      println(x1 + x2)

      var y1 = (2.0, 12.0) // you must declare var because converting
      var y2 = (13.0, 24.0)
      println(y1 + y2)
      val d = 4 + x1
      println(d)
   }

}

case class PromPrefer(mes: String)

object Joe {
   implicit val promp = new PromPrefer("Enter Key ")
}

object Greeting {
   def showGreet(s: String)(promp: PromPrefer) {
      println("Hello : " + s)
      println(promp.mes + " >")
   }

   def anotherFun(s: String)(p: PromPrefer) {

   }
}